Native TLS for async-std or tokio.
This crate uses SChannel on Windows (via schannel), Secure Transport on OSX (via security-framework), and OpenSSL (via openssl) on all other platforms.
Installation
Cargo Feature Flags
-
runtime-async-std
(on by default): Use theasync-std
runtime. -
runtime-tokio
: Use thetokio
runtime. This is mutually exclusive withruntime-async-std
.
Example
async-std
Requires
runtime-async-std
feature (on by default).
# Cargo.toml
[]
= "0.4"
use *;
use TcpStream;
let stream = connect.await?;
let mut stream = connect.await?;
stream.write_all.await?;
let mut res = Vec new;
stream.read_to_end.await?;
println!;
tokio
Requires
runtime-tokio
feature.
# Cargo.toml
[]
= { = "0.4", = false, = [ "runtime-tokio" ] }
use *;
use TcpStream;
let stream = connect.await?;
let mut stream = connect.await?;
stream.write_all.await?;
let mut res = Vec new;
stream.read_to_end.await?;
println!;
Contributing
Want to join us? Check out our "Contributing" guide and take a look at some of these issues: